package homework.hoomework_10.phone;

import java.util.Objects;

/**
 * @author 朱
 * @date 2019042221:48
 */
public class Phone {
    private String type;
    private String name;
    private String color;

    public Phone(){

    }

    public Phone(String type, String name, String color) {
        this.type = type;
        this.name = name;
        this.color = color;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Phone phone = (Phone) o;
        return Objects.equals(type, phone.type) &&
                Objects.equals(name, phone.name) &&
                Objects.equals(color, phone.color);
    }

    @Override
    public int hashCode() {
        return Objects.hash(type, name, color);
    }

    @Override
    public String toString() {
        return "Phone{" +
                "type='" + type + '\'' +
                ", name='" + name + '\'' +
                ", color='" + color + '\'' +
                '}';
    }
}
